package vo {
	import mx.collections.ArrayCollection;
	import org.davekeen.flextrine.orm.FlextrineError;
	
	[Bindable]
	public class AppointmentEntityBase {
		
		[Transient]
		public var __isUnserialized__:Boolean;
		
		[Transient]
		public var __isInitialized__:Boolean = true;
		
		[Transient]
		public var __isCollectionInitializedMap__:Object = new Object();
		
		[Id]
		public var id:String;
		
		public function get date():Date { checkIsInitialized("date"); return (_date && _date.getTime() > 0) ? _date : null; }
		public function set date(value:*):void { _date = (value is Date) ? value : new Date(value); }
		private var _date:Date;
		
		[Association]
		public function get doctor():Doctor { checkIsInitialized("doctor"); return _doctor; }
		public function set doctor(value:Doctor):void { _doctor = value; }
		private var _doctor:Doctor;
		
		[Association]
		public function get patient():Patient { checkIsInitialized("patient"); return _patient; }
		public function set patient(value:Patient):void { _patient = value; }
		private var _patient:Patient;
		
		public function AppointmentEntityBase() {
		}
		
		public function toString():String {
			return "[Appointment id=" + id + "]";
		}
		
		private function checkIsInitialized(property:String):void {
			if (!__isInitialized__ && __isUnserialized__)
				throw new FlextrineError("Attempt to get property '" + property + "' on unitialized Appointment.  Consider using EntityManager::require or eager loading.", FlextrineError.ACCESSED_UNITIALIZED_ENTITY);
		}
		
	}

}
